///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////  Transport Helicopters  //////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

RUM_THel_landwaypoint = {
	_mkrname = _this select 0;

	_markerpos = getmarkerpos _mkrname;
	_helo_marker_distance = _markerpos distance [getPos _helo select 0, getPos _helo select 1, 0];
	_dist1 = round _helo_marker_distance;

	_grp = _this select 1;
	_pos = _markerpos;
	_stg = "RUM_THel_land = '"+(format ["%1",_helo]+"'");

	[_helo, _dist1, _mkrname, _callsign] spawn {
		_helo = _this select 0;
		_dist1 = _this select 1;
		_mkrname = _this select 2;
		_callsign = _this select 3;
		_distchk = true;

		_markerpos = getmarkerpos _mkrname;
		_helo_marker_distance = _markerpos distance [getPos _helo select 0, getPos _helo select 1, 0];

		while {_distchk} do {
			if ((_helo_marker_distance) <= 150) then{
				_distchk = false;
			}else{
				If (!alive _helo) then {
					player sidechat "Helo has crashed or has been shot down.";
					_distchk = false;
					exit;	
				}else{
					_helo_marker_distance = (_markerpos distance [getPos _helo select 0, getPos _helo select 1, 0]);
					_helo_height = (getPos _helo select 2);
					player sidechat format ["%1 this is %2, we are %3 meters from your LZ - OVER",RUM_COM_Callsign, _callsign, round _helo_marker_distance];
					sleep 45;
				};
			};
		};
	};


	_wp=_grp addWaypoint [_pos, 0];
	_wp setWaypointStatements ["true", _stg];
	_wp setWaypointType "MOVE";
	_wp setWaypointSpeed "NORMAL";
	_wp setWaypointCombatMode "GREEN";
	_wp setWaypointCompletionRadius 100;

	if(RUM_THEL_invisibleH)then{_lz = createVehicle ["HeliHEmpty", _pos, [], 0, "NONE"]};
	_lz;
};

RUM_THel_movewaypoint = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];

	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};




	_wp=_grp addWaypoint [_pos, 0];
	_wp setWaypointType "MOVE";
	_wp setWaypointCombatMode "GREEN";
	_wp setWaypointSpeed "NORMAL";
	_wp setWaypointBehaviour "CARELESS";
	_wp setWaypointCompletionRadius 50;
	_wp setWaypointStatements ["true", ""];
	_helo flyInHeight RUM_THEL_flyHeight;
	if(RUM_THel_Special == "Para Drop")then{_helo FlyInHeight RUM_THEL_flyHeightPara};
	if(RUM_THel_Special == "HALO Jump")then{_helo FlyInHeight RUM_THEL_flyHeightHALO};
};

RUM_THel_moveWPNormal = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_heloTakeOff2 = true;			
	while {_heloTakeOff2} do {
		_distanceToDeck = round(getposASL _helo select 2);
		_heightToHomePlate = (_distanceToDeck - (getposASL _home select 2));
		_distToHomePlate = round( _helo distance _home);
		if (_distToHomePlate >= 55) then {
			deleteWaypoint [_grp, 0];
			_wp=_grp addWaypoint [_pos, 0];
			_wp setWaypointType "MOVE";
			_wp setWaypointCombatMode "GREEN";
			_wp setWaypointSpeed "NORMAL";
			_wp setWaypointBehaviour "CARELESS";
			_wp setWaypointCompletionRadius 100;
			_helo flyInheight 45;

			sleep 5;
			_helo flyInheight RUM_THEL_flyHeight;
			_heloTakeOff2 = false;
		};
	};
};

RUM_THel_moveWPTakeoff = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	if (_class == "MV22") then {
		_wp=_grp addWaypoint [_pos, 0];
		_wp setWaypointType "MOVE";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointBehaviour "CARELESS";
		_wp setWaypointCompletionRadius 0;
		_helo flyInheight 60;
	}else{
		_wp=_grp addWaypoint [_pos, 0];
		_wp setWaypointType "MOVE";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointBehaviour "CARELESS";
		_wp setWaypointCompletionRadius 100;
		_helo flyInheight 18;
	};
};

RUM_THel_moveWPLZDustOff = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	if (_class == "MV22") then {
		_wp=_grp addWaypoint [_pos, 0];
		_wp setWaypointType "MOVE";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointBehaviour "CARELESS";
		_wp setWaypointCompletionRadius 0;
		_helo flyInheight 60;
	}else{
		_wp=_grp addWaypoint [_pos, 0];
		_wp setWaypointType "MOVE";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointBehaviour "CARELESS";
		_wp setWaypointCompletionRadius 50;
		_helo flyInheight 22;
	};
};

RUM_THel_moveWPLZDustOffNormal = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_heloDustOff2 = true;			
	while {_heloDustOff2} do {
		_distFromDustOff = round( _helo distance _pos);
		if (_distFromDustOff >= 100) then {
			deleteWaypoint [_grp, 0];

			_wp=_grp addWaypoint [_pos, 0];
			_wp setWaypointType "MOVE";
			_wp setWaypointCombatMode "GREEN";
			_wp setWaypointSpeed "NORMAL";
			_wp setWaypointBehaviour "CARELESS";
			_wp setWaypointCompletionRadius 100;
			_helo flyInheight 45;
			sleep 5;
			_helo flyInheight RUM_THEL_flyHeight;
			_heloDustOff2 = false;
		};
	};
};

RUM_THel_LandHome = {
	if (surfaceIsWater (getpos _home)) then {
		// player sidechat format["Heli is on LHD or Ship, %1",_heliRoute];

		_heloRTBWaypoint = true;
		
		while {_heloRTBWaypoint} do {
			sleep .05;
			_distanceToIngress = round(_ingress distance _helo);
			// hintsilent format["distance from home plate: %1",_distanceToIngress];
			if (_distanceToIngress <=160) then {
				_lz = createVehicle ["HeliHEmpty", getposASL _home, [], 0, "NONE"];
				_lz setposASL getPosASL _home;




				_wp=_grp addWaypoint [getposASL _lz, 0];
				_wp setWaypointType "GETOUT";
				_wp setWaypointSpeed "LIMITED";
				_wp setWaypointBehaviour "CARELESS";
				_wp setWaypointCombatMode "GREEN";


				_wp setWaypointCompletionRadius 0;
				_helo flyInheight (RUM_THEL_flyHeight -35);
				_stg = "RUM_THel_endflight = '"+(format ["%1",_helo])+"'";
				_wp setWaypointStatements ["true", _stg];
				// _lz;
				
				// ends the while loop
				_heloRTBWaypoint = false;
			};
		};
		
		// starts new while loop for landing procedures...
		_heloRTBWaypointH = true;
		
		while {_heloRTBWaypointH} do {
			sleep .05;
			_distanceToDeck = round(getposASL _helo select 2);
			_heightToHomePlate = round((getposASL _helo select 2) - (getposASL _home select 2));
			_distToHomePlate = round( _helo distance _home);
			if (_distToHomePlate <= 70) then {
				if (_heightToHomePlate <= 0.5) then {
				sleep 3;
				_helo setFuel 0;
				sleep 5;

				// ends the while loop.
				_heloRTBWaypointH = false;
				}else{
					// hintsilent format ["Height Above Home Plate: %1",_heightToHomePlate];
				};
			}else{
				// hintsilent format ["Distance to Home Plate: %1",_distToHomePlate];
			};
		};
	}else{

		// This section of the if statment is for land based helo's
		// player sidechat format["Heli is not over water, %1",_heliRoute];
		// waits till closer to ingress position before moving to final approach.
		waituntil{((_ingress distance [getPos _helo select 0, getPos _helo select 1, 0]) <= 200)};

		_wp=_grp addWaypoint [getpos _home, 0];
		_wp setWaypointType "GETOUT";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointBehaviour "CARELESS";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointCompletionRadius 50;
		_helo flyInheight (RUM_THEL_flyHeight - 45);
		_stg = "RUM_THel_endflight = '"+(format ["%1",_helo])+"'";
		_wp setWaypointStatements ["true", _stg];

	};
};

RUM_THel_Spawn = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_wp=_grp addWaypoint [_pos, 0];
	_wp setWaypointType "MOVE";
	_wp setWaypointSpeed "FULL";
	_wp setWaypointCombatMode "GREEN";
	_wp setWaypointCompletionRadius 50;
};

RUM_THel_VehicleOptions = {
	// these options are timed for the CH53, although simlar to other classnames, each vehicle option is tuned to its own delays to make animations look better.
	if (_class == "MV22") then {
	// player sidechat "MV22 Options";
		[_helo] spawn {
			_helo = _this select 0;
			_vehOption = true;
			_vehOption1 = true;
			_vehOption2 = false;
			while {_vehOption} do {
				sleep 1;
				_helo_height = round (getPos _helo select 2);
				// hintsilent format ["Altitude: %1", _helo_height];
				if (_vehOption1)then{
					if (((getPos _helo select 2) <= 4)) then {
						// player sidechat "Opening Ramp & Doors";
						_helo animate ["ramp_top",1];
						_helo animate ["ramp_bottom",1];
						sleep 3;
						_helo animate ["door1_top", 1];
						_helo animate ["door1_bottom", 1];
						_vehOption1 = false;
						_vehOption2 = true;
					};
				};
				if (_vehOption2)then{
					if (((getPos _helo select 2) >= 4)) then {
						// player sidechat "closing doors & Ramp";
						_helo animate ["door1_top", 0];
						_helo animate ["door1_bottom", 0];
						sleep 3;
						_helo animate ["ramp_top",0];
						_helo animate ["ramp_bottom",0];
						_vehOption = false;
						_vehOption2 = false;
					};
				};
			};
		};
		// this will be for the HALO/Para ramp to open before exit... 
		// if(RUM_THel_Special == "HALO Jump")then{
		// _helo FlyInHeight RUM_THEL_flyHeightHALO;
		// };

	};
	if (_class == "USEC_ch53_E") then {
	// player sidechat "CH53 Options";
		[_helo, _ingress] spawn {
			_helo = _this select 0;
			_ingress = _this select 1;
			_vehOption = true;
			_vehOption1 = true;
			_vehOption2 = false;
			while {_vehOption} do {
			// this animate ["ramp_bottom",0];this animate ["ramp_top",0];
				sleep 1;
				_helo_height = round (getPos _helo select 2);
				// hintsilent format ["Altitude: %1", _helo_height];
				if (_vehOption1)then{
					if (((getPos _helo select 2) <= 6)) then {
						// player sidechat "Opening Ramp";
						_helo animate ["ramp_top",1];
						_helo animate ["ramp_bottom",1];
						_vehOption1 = false;
						_vehOption2 = true;
					};
					// should lower the gear once it reached the _ingress point to land
					_distToIngress = round(_ingress distance _helo);
					// hintsilent format["distance from home plate: %1",_distToIngress];
					if (_distToIngress <=160) then {
						// player sidechat "Lowering Gear";
						[_helo] execvm "\usec_ch53\scripts\ch53_geardown.sqf";
					};
				};
				if (_vehOption2)then{
					if (((getPos _helo select 2) >= 4)) then {
						// player sidechat "Closing Ramp";
						_helo animate ["ramp_top", 0];
						_helo animate ["ramp_bottom", 0];
						sleep 4;
						// player sidechat "Raising Gear";
						[_helo] execvm "\usec_ch53\scripts\ch53_gearup.sqf";
						_vehOption = false;
						_vehOption2 = false;
					};
				};
			};
		};
		// this will be for the HALO/Para ramp to open before exit... 
		// if(RUM_THel_Special == "HALO Jump")then{
		// _helo FlyInHeight RUM_THEL_flyHeightHALO;
		// };

	};
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////  Attack Helicopters  /////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
RUM_AHel_movewaypoint = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_wpAH=_grp addWaypoint [_pos, 0];
	_wpAH setWaypointStatements ["true", ""];
	_wpAH setWaypointType "MOVE";
	_wpAH setWaypointSpeed "NORMAL";
	_wpAH setWaypointCombatMode "GREEN";
	_wpAH setWaypointCompletionRadius 50;
};
RUM_AHel_SAD = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_wpAH=_grp addWaypoint [_pos, 0];
	_wpAH setWaypointStatements ["true", ""];
	_wpAH setWaypointType "SAD";
	_wpAH setWaypointSpeed "NORMAL";
	_wpAH setWaypointCombatMode "RED";
	_wpAH setWaypointCompletionRadius 50;	
};
RUM_AHel_moveWPTakeoff = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_wpAH=_grp addWaypoint [_pos, 0];
	_wpAH setWaypointType "MOVE";
	_wpAH setWaypointCombatMode "GREEN";
	_wpAH setWaypointSpeed "NORMAL";
	_wpAH setWaypointBehaviour "CARELESS";
	_wpAH setWaypointCompletionRadius 50;
	_helo flyInheight 18;
};
RUM_AHel_moveWPNormal = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_heloTakeOff2 = true;			
	while {_heloTakeOff2} do {
		_distanceToDeck = round(getposASL _helo select 2);
		_heightToHomePlate = (_distanceToDeck - (getposASL _home select 2));
		_distToHomePlate = round( _helo distance _home);
		if (_distToHomePlate >= 55) then {
			deleteWaypoint [_grp, 0];
			_wpAH=_grp addWaypoint [_pos, 0];
			_wpAH setWaypointType "MOVE";
			_wpAH setWaypointCombatMode "GREEN";
			_wpAH setWaypointSpeed "NORMAL";
			_wpAH setWaypointBehaviour "CARELESS";
			_wpAH setWaypointCompletionRadius 50;
			_helo flyInheight 45;
			sleep 7;
			_helo flyInheight RUM_AHEL_flyHeight;
			_heloTakeOff2 = false;
		};
	};
};
RUM_AHel_LandHome = {
	sleep 30;

_wp=_grp addWaypoint [getpos _ingress, 0];
_wp setWaypointType "MOVE";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointCombatMode "GREEN";
_wp setWaypointCompletionRadius 50;

	if (surfaceIsWater (getpos _home)) then {
		// player sidechat format["Heli is on LHD or Ship, %1",_heliRoute];

		_heloRTBWaypoint = true;
		
		while {_heloRTBWaypoint} do {
			sleep .05;
			_distanceToIngress = round(_ingress distance _helo);
			// hintsilent format["distance from home plate: %1",_distanceToIngress];
			if (_distanceToIngress <=160) then {
				_lz = "HeliHEmpty" createVehicle (getposASL _home);
				_lz setposASL [getPosASL _home];
				_wpAH=_grp addWaypoint [getposASL _lz, 0];
				_wpAH setWaypointType "GETOUT";
				_wpAH setWaypointSpeed "LIMITED";
				_wpAH setWaypointBehaviour "CARELESS";
				_wpAH setWaypointCombatMode "GREEN";
				_wpAH setWaypointCompletionRadius 0;
				_stg = "RUM_AHel_endflight = '"+(format ["%1",_helo])+"'";
				_wpAH setWaypointStatements ["true", _stg];
				// _lz;
				
				// ends the while loop
				_heloRTBWaypoint = false;
			};
		};
		
		// starts new while loop for landing procedures...
		_heloRTBWaypointH = true;
		
		while {_heloRTBWaypointH} do {
			sleep .05;
			_distanceToDeck = round(getposASL _helo select 2);
			_heightToHomePlate = round((getposASL _helo select 2) - (getposASL _home select 2));
			_distToHomePlate = round( _helo distance _home);
			if (_distToHomePlate <= 70) then {
				_helo doMove [ (getPos _helo select 0), (getPos _helo select 1), 60];
				_helo flyInHeight 60;
				_pilot disableAI "FSM";
				if (_distToHomePlate <= 30) then {
				// player sidechat "doing the move!!";
				_helo doMove [ (getPos _helo select 0), (getPos _helo select 1), (getPos _helo select 2) +15];
				_helo flyInHeight ((getPos _helo select 2) +15);
				};
				if (_heightToHomePlate <= 0.5) then {
				sleep 3.5;
				_helo setFuel 0;
				sleep 5;

				// ends the while loop.
				_heloRTBWaypointH = false;
				}else{
					// hintsilent format ["Height Above Home Plate: %1\nDistance to Home Plate: %2",_heightToHomePlate,_distToHomePlate];
				};
			}else{
				// hintsilent format ["Distance to Home Plate: %1",_distToHomePlate];
			};
		};
	}else{

		// This section of the if statment is for land based helo's
		// player sidechat format["Heli is not over water, %1",_heliRoute];
		// waits till closer to ingress position before moving to final approach.
		waituntil{((_ingress distance [getPos _helo select 0, getPos _helo select 1, 0]) <= 200)};

		_wpAH=_grp addWaypoint [getpos _home, 0];
		_wpAH setWaypointType "GETOUT";
		_wpAH setWaypointSpeed "NORMAL";
		_wpAH setWaypointBehaviour "CARELESS";
		_wpAH setWaypointCombatMode "GREEN";
		_wpAH setWaypointCompletionRadius 50;
		_helo flyInheight (RUM_AHEL_flyHeight - 45);
		_stg = "RUM_AHel_endflight = '"+(format ["%1",_helo])+"'";
		_wpAH setWaypointStatements ["true", _stg];

	};
};
RUM_AHel_MoveFromStation = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_wpAH=_grp addWaypoint [_pos, 0];
	_wpAH setWaypointType "MOVE";
	_wpAH setWaypointSpeed "NORMAL";
	_wpAH setWaypointBehaviour "CARELESS";
	_wpAH setWaypointCombatMode "GREEN";
	_wpAH setWaypointCompletionRadius 0;
	_helo flyInheight RUM_AHEL_flyHeight;
};
RUM_AHel_MoveToStation = {
	_heloRTBWaypointH = true;
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	_wpAH=_grp addWaypoint [_pos, 0];
	_wpAH setWaypointType "MOVE";
	_wpAH setWaypointSpeed "NORMAL";
	_wpAH setWaypointBehaviour "CARELESS";
	_wpAH setWaypointCombatMode "GREEN";
	_wpAH setWaypointCompletionRadius 0;
	_stg = "RUM_AHel_endflight = '"+(format ["%1",_helo])+"'";
	_wpAH setWaypointStatements ["true", _stg];
};
RUM_AHel_moveWPStation = {
player sidechat format ["%1 is moving to station.",_callsign];
	// station stage - helo will reach staitoned area and lower to a concealment height to settle until called upon
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = [0,0,0];
	if(count _this == 2)then{_pos = getMarkerpos _mkrname}else{_pos = getpos (_this select 2)};
	while {_heloNewStation} do {
		if ((_helo_marker_distance) <= 150) then{
			// this is a locality check for client side or server side
				_wpAH=_grp addWaypoint [_pos, 0];
				_wpAH setWaypointType "MOVE";
				_wpAH setWaypointSpeed "NORMAL";
				_wpAH setWaypointBehaviour "CARELESS";
				_wpAH setWaypointCombatMode "GREEN";
				_wpAH setWaypointCompletionRadius 0;
				_helo flyInheight RUM_AHEL_flyStationHeight;
				sleep 5;
				deleteWaypoint [_grp, 0];
				_heloNewStation = false;
			
		}else{
			// this will check to see if the helo has crashed or has been destroyed and exit the loop.
			If (!alive _helo) then {
				player sidechat format ["%1 has crashed or has been destroyed.", _helo];
				// hintsilent format ["%1 has crashed or has been destroyed.", _helo];
				_heloNewStation = false;
				exit;	
			}else{
				_helo_marker_distance = round (_markerpos distance [getPos _helo select 0, getPos _helo select 1, 0]);
				_helo_height = round (getPos _helo select 2);
				// hintsilent format ["Distance to Location: %1\n\nCurrent Altitude: %2", round _helo_marker_distance, _helo_height];
				sleep .05;
			};
		};
	};
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////  Supply Helicopters  /////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

RUM_SUP_landwaypoint = {
	_mkrname = _this select 0;

	_markerpos = getmarkerpos _mkrname;
	_helo_marker_distance = _markerpos distance [getPos _helo select 0, getPos _helo select 1, 0];
	_dist1 = round _helo_marker_distance;

	_grp = _this select 1;
	_pos = getMarkerpos _mkrname;
	_wp=_grp addWaypoint [_pos, 0];
	_stg = "RUM_SUP_land = '"+(format ["%1",_helo]+"'");
	
	[_helo, _dist1, _mkrname,_callsign] spawn {
		_helo = _this select 0;
		_dist1 = _this select 1;
		_mkrname = _this select 2;
		_callsign = _this select 3;
		_distchk = true;

		_markerpos = getmarkerpos _mkrname;
		_helo_marker_distance = _markerpos distance [getPos _helo select 0, getPos _helo select 1, 0];

		while {_distchk} do {
			if ((_helo_marker_distance) <= 150) then{
				_distchk = false;
			}else{
				If (!alive _helo) then {
					player sidechat "Helo has crashed or has been shot down.";
					_distchk = false;
					exit;	
				}else{
					_helo_marker_distance = (_markerpos distance [getPos _helo select 0, getPos _helo select 1, 0]);
					_helo_height = (getPos _helo select 2);
					player sidechat format ["%1 this is %2, we are %3 meters from your DZ - OVER",RUM_COM_Callsign, _callsign, round _helo_marker_distance];
					sleep 45;
				};
			};
		};
	};

	_wp setWaypointStatements ["true", _stg];
	_wp setWaypointSpeed "MOVE";
	_wp setWaypointSpeed "NORMAL";
	_wp setWaypointCombatMode "GREEN";
	_wp setWaypointCompletionRadius 150;
	if ("plane" in _heloarr) then {
		_helo flyInHeight RUM_SUP_flyDropHeightPLN;
	}else{
		_helo flyInHeight RUM_SUP_flyDropHeight;
	};
	_dz;
};

RUM_SUP_movewaypoint = {
	_mkrname = _this select 0;
	_grp = _this select 1;
	_pos = getMarkerpos _mkrname;
	_varOM = true;
	if (_varOM)then{
		_wp=_grp addWaypoint [_pos, 0];
		_wp setWaypointType "MOVE";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointBehaviour "CARELESS";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointCompletionRadius 100;
		if(_helo iskindof "Plane")then{
			_helo flyInHeight (RUM_SUP_flyHeightPLN + 100);
		}else{
			_helo flyInheight (RUM_SUP_flyHeight - 62);
		};
		sleep 5;
		_wp=_grp addWaypoint [_pos, 0];
		_wp setWaypointType "MOVE";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointBehaviour "CARELESS";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointCompletionRadius 100;
		if(_helo iskindof "Plane")then{
			_helo FlyInHeight RUM_SUP_flyHeightPLN;
		}else{
			_helo FlyInHeight RUM_SUP_flyHeight;
		};
	}else{
		_wp=_grp addWaypoint [_pos, 0];
		_wp setWaypointStatements ["true", ""];
		_wp setWaypointType "MOVE";
		_wp setWaypointSpeed "NORMAL";
		_wp setWaypointCombatMode "GREEN";
		_wp setWaypointCompletionRadius 150;
		if(_helo iskindof "Plane")then{
			_helo FlyInHeight RUM_SUP_flyHeightPLN;
		}else{
			_helo FlyInHeight RUM_SUP_flyHeight;
		};
	};
};
